﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework;

namespace Tanks
{
    class E50 : ITank
    {
        public E50(Texture2D _tex, Texture2D _texDead, Vector2 position, float rotation, Game1 game, KeyboardSettings keySetting) 
            : base(_tex, _texDead, game, keySetting)
        {
            this.position.X = position.X;
            this.position.Y = position.Y;
            speed = 0.7f;
            currentSpeed = speed;
            this.rotation = rotation; 
            health = 100;
            currentHealth = health;
            rotationSpeed = 0.015f;               //10947
            currentRotationSpeed = rotationSpeed;
        }

        protected override void Shoting()
        {
            
            this.game.AddObject(new Animation(Resources.lenta, this.game,
                new Vector2(this.position.X - (float)((this.texture.Width / 2) * Math.Cos(rotation)),
                            this.position.Y - (float)((this.texture.Width / 2) * Math.Sin(rotation))),
                 (this.rotation + 3.14f), 30, 1.0f));
            this.game.AddObject(new FireE50(game,
                new Vector2(this.position.X - (float)((this.texture.Width / 2) * Math.Cos(rotation)),
                            this.position.Y - (float)((this.texture.Width / 2) * Math.Sin(rotation))),
                this.rotation));
        }
    }
}
